/************************************************************************/
/*    Author: Scott Bevin                                               */
/************************************************************************/

#pragma once

#include <OIS/OIS.h>

#include "../Application.h"
#include "../XInput/Input.h"

namespace XF
{
	class SystemComponent
	{
	private:
		bool mInitialised;
		OIS::Keyboard * mKeyBoard;

	protected:
		Application *mOwnerApp;

		virtual bool OnInitialise(){return false;} //chris i modified this and all existing components to be bools and added some error checking
		virtual void OnHandleInput(double dT, Input *input){}
		virtual void OnUpdate(double dT){}
		virtual void OnShutDown(){}

		SystemComponent(Application *ownerApp)
		{
			mInitialised = false;

			mOwnerApp = ownerApp;
		}

	public:

		bool Initialise(){mInitialised = OnInitialise(); return mInitialised;} //so i modified this aswell
		void HandleInput(double dT, Input *input){OnHandleInput(dT, input);}
		void Update(double dT){OnUpdate(dT);}
		void ShutDown(){OnShutDown();}

		bool Initialised(){return mInitialised;}

		OgreRenderer *GetRenderer(){return mOwnerApp->GetRenderer();}
		Application *GetApplication(){return mOwnerApp;}
	};
}